<!-- 我处理的-费率详情组件 -->
<template name="mydealdetailCom1">
	<view class="mydealdetailCom mydealdetailCom1">
		<view class="content">
			<view class="list">
				<view class="list_item">
					<view class="item_title">基础支付费率</view>
					<view class="item_text">{{infoData.rate/100}}%</view>
				</view>
			</view>
			<view class="list">
				<view class="list_item">
					<view class="item_title">BD</view>
					<view class="item_text">{{infoData.realname}} AID{{infoData.salesman_id}}</view>
				</view>
				<view class="list_item">
					<view class="item_title">门店地址</view>
					<view class="item_text">{{infoData.address}}</view>
				</view>
				<view class="list_item">
					<view class="item_title">商家电话</view>
					<view class="item_text">{{infoData.phone}}</view>
				</view>
				<view class="list_item">
					<view class="item_title">提交时间</view>
					<view class="item_text">{{infoData.submit_time}}</view>
				</view>
			</view>
			<view class="list">
				<view class="list_item">
					<view class="item_title">备注</view>
					<view class="item_text">
						<input type="text" :disabled="dealtype != 0" v-model="remark" :placeholder="dealtype == 0?'不超过50字':''" />
					</view>
				</view>
			</view>
		</view>
		<view class="btn" v-if="dealtype == 0">
			<button type="default" class="btn_reject" @click="audit(2)">审核拒绝</button>
			<button type="primary" @click="audit(1)">审核通过</button>
		</view>
		<view class="audit">
			<view class="audit_title">审核流程</view>
			<view class="audit_con">
				<view class="audit_left"></view>
				<view class="audit_right">
					<view class="right_step">
						<view class="">
							<view class="rigth_stepTitle">发起申请</view>
							<view class="greyfont">{{infoData.realname}}AID   {{infoData.salesman_id}}</view>
						</view>
						<view class="greyfont">{{infoData.submit_time}}</view>
					</view>
					<view class="right_step">
						<view class="">
							<view class="rigth_stepTitle">
								{{infoData.operator_name}}
								<text :class="statusColor[infoData.status]">
									({{statusObj[infoData.status]}})
								</text>
							</view>
							<view class="greyfont">备注:{{infoData.reason}}</view>
						</view>
						<view class="greyfont">{{infoData.updated_at}}</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import { shoprateaudit } from '../../../api/index.js'
	export default {
		data() {
			return {
				remark:'',
				statusObj:{
					'1':'审核通过',
					'2':'审核失败',
					'0':'审核中'
				},
				statusColor:{
					'0':'orangefont',
					'1':'bluefont',
					'2':'redfont'
				}
			}
		},
		mounted:function(){
			
		},
		props: {
			infoData:'',
			dealtype:''
		},
		methods: {
			//我处理的-外卖
			audit:function(status){
				let that = this;
				console.log(status)
				if(that.remark.length>50){
					uni.showTabBar({
						icon:'none',
						title:'备注字数不可超过50个'
					})
					return ;
				}
				shoprateaudit({
					id:that.infoData.suid,//记录id
					status:status,//审核状态1-审核通过,2-审核未通过
					reason:that.remark
				}).then((res) => {
					console.log(res)
					uni.showModal({
						title:'提示',
						content: res.msg,
						complete:function(){
							if(res.code == 0){
								uni.navigateBack({
									
								})
							}
						}
					})
				}).catch((e) => {
					console.log(e);
				})
			}
		},
		watch:{
			infoData:function(){
				this.remark = this.infoData.reason
			}
		}
	}
</script>

<style lang="scss" scoped>
	@import './mydealdetailCom.scss';
</style>